import request from '@/utils/request'

//统一字典下拉框查询
export function adminDict(params) {
    return request({
        url: `common/v1/adminDict`,
        method: 'get',
        params
    })
}

// 查询空投信息列表
export function airdropList(query) {
  return request({
    url: '/airdrop/v1/list',
    method: 'get',
    params: query
  })
}
// 新增空投
export function addAirdrop(data) {
  return request({
    url: '/airdrop/v1',
    method: 'post',
    data: data
  })
}
// 编辑空投
export function updateAirdrop(data) {
  return request({
    url: '/airdrop/v1',
    method: 'put',
    data: data
  })
}
// 查询空投权益卡下拉框
export function airdropEquityLs(query) {
  return request({
    url: '/airdrop/v1/equity/list',
    method: 'get',
    params: query
  })
}
// 查询空投奖品盲盒下拉框
export function airdropBoxLs(query) {
  return request({
    url: '/airdrop/v1/box/list',
    method: 'get',
    params: query
  })
}
// 查询空投信息详情
export function getAirdropDetail(id) { 
  return request({
    url: '/airdrop/v1/detail/' + id,
    method: 'get'
  })
}
// 查询空投用户列表
export function getAirdropCustomerLs(id) { 
  return request({
    url: '/airdrop/v1/customer/list/' + id,
    method: 'get'
  })
}
// 新增空投用户列表
export function addAirdropCustomer(params) {
  return request({
    url: '/airdrop/v1/customer',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params: params
  })
}
// 删除空投用户
export function removeAirdropCustomer(params) {
  return request({
    url: '/airdrop/v1/customer',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    method: 'DELETE',
    params: params
  })
}
// 移除参保卡
export function performAirdrop(id) {
  return request({
    url: `/airdrop/v1/execute/${id}`,
    method: 'put',
  })
}
// 保存 激励规则配置
export function saveIncentiveRules(data) {
  return request({
    url: '/system/config/v1/saveIncentiveRules',
    method: 'post',
    data: data
  })
}
// 获取 激励规则配置
export function getIncentiveRules(query) { 
  return request({
    url: '/system/config/v1/getIncentiveRules',
    method: 'get',
    params: query
  })
}